package cn.carl.frame.test.route;

import cn.carl.frame.core.config.Route;

import java.util.Map;
import java.util.regex.Pattern;

public class RouteA implements Route {
	{
		init();
	}

	public Route init() {
		addRoute(Object.class, Pattern.compile("^/devices/([^/]+)$"))
				.addRoute(String.class, Pattern.compile("^/user/([^/]+)$"))
				.addRoute(Integer.class, Pattern.compile("^/sys/([^/]+)$"))
				.addRoute(System.class, Pattern.compile("^/sys/([^/]+)$"));
		return this;
	}

	public Map<Class<?>, Pattern> getRoute() {
		return routes;
	}

	@Override
	public void destroy() {
		stop();
	}
}
